package com.blackjack.cards
{
	import com.blackjack.Game;

	public class Deck
	{
		private var _deck:Array;
		
		public function Deck()
		{
			_deck = new Array();
		}
		
		public function get deck():Array{return _deck;}
		
		public function addCard(card:Card):void{
			_deck.push(card);
			Game.instance.addChild(card);
		}
		
		public function resetDeck():void{
			while(_deck.length){
				var card:Card = _deck.pop();
				Game.instance.removeChild(card);
			}
		}
		
		public function update():void{
			for each(var c:Card in _deck){
				c.update();
			}
		}
	}
}